﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using ImageStoreNET.Developer;
using System.IO;

namespace EPiServer.Municipality.Services
{
    /// <summary>
    /// Summary description for UploadService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.Web.Script.Services.ScriptService]
    public class UploadService : System.Web.Services.WebService {

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public void Upload() {
            HttpPostedFile fileUpload = HttpContext.Current.Request.Files[0];
            if (fileUpload != null)
            {
                IVDataFactory.UploadFile(IVDataFactory.CurrentUser, fileUpload);
            }
        }
    }
}
